//
//  PTTextField.m
//  PrayerTimes
//
//  Created by Igor Karpenko on 6/10/13.
//  Copyright (c) 2013 Igor Karpenko. All rights reserved.
//

#import "PTTextField.h"

@implementation PTTextField

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (!self) {
        return nil;
    }
    return self;
}


- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];
    
    UIImage *backgroundImage = [[UIImage imageNamed:@"chn_textFieldBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0f, 15.0f, 0.0f, 15.0f)];
    [backgroundImage drawInRect:[self bounds]];
}


- (CGRect)textRectForBounds:(CGRect)bounds {
	return CGRectMake(bounds.origin.x + 10, bounds.origin.y,
					  bounds.size.width - 20, bounds.size.height + 2.0f);
}


- (CGRect)editingRectForBounds:(CGRect)bounds {
	return [self textRectForBounds:bounds];
}

@end
